<template>
  <div class="baseInfo">
    <vxe-table
      border
      stripe
      ref="tableRef"
      size="small"
      header-align="center"
      :data="tableData"
    >
      <vxe-column type="seq" width="70" align="center" fixed="left"></vxe-column>
      <vxe-column field="shipmentCode" show-overflow="title" align="center" title="发货单号"></vxe-column>
      <vxe-column field="orderCode" show-overflow="title" align="center" title="订单编号"></vxe-column>
      <vxe-column field="platformOrderCode" show-overflow="title" align="center" title="平台单号"></vxe-column>
      <vxe-column field="orderType" show-overflow="title" align="center" title="订单类型"></vxe-column>
      <vxe-column field="platformName" show-overflow="title" align="center" title="订单来源"></vxe-column>
      <vxe-column field="shopName" show-overflow="title" align="center" title="店铺名称"></vxe-column>
      <vxe-column field="clientName" show-overflow="title" align="center" title="会员名称"></vxe-column>
      <vxe-column field="bizUser" show-overflow="title" align="center" title="业务员"></vxe-column>
      <vxe-column field="orderCount" show-overflow="title" align="center" title="商品数量"></vxe-column>
      <vxe-column field="weight" show-overflow="title" align="center" title="标准重量"></vxe-column>
      <vxe-column field="volume" show-overflow="title" align="center" title="标准体积"></vxe-column>
      <vxe-column field="totalPrice" show-overflow="title" align="center" title="订单金额"></vxe-column>
      <vxe-column field="yieldAmount" show-overflow="title" align="center" title="让利金额"></vxe-column>
      <vxe-column field="expressFee" show-overflow="title" align="center" title="物流费用"></vxe-column>
      <vxe-column field="payAmount" show-overflow="title" align="center" title="支付金额"></vxe-column>
      <vxe-column field="refund" show-overflow="title" align="center" title="退款金额"></vxe-column>
      <vxe-column field="buyerRemark	" show-overflow="title" align="center" title="买家留言"></vxe-column>
      <vxe-column field="sellerRemark" show-overflow="title" align="center" title="卖家留言"></vxe-column>
      <vxe-column field="secRemark" show-overflow="title" align="center" title="二次备注"></vxe-column>
      <vxe-column field="extInfo" show-overflow="title" align="center" title="附加信息"></vxe-column>
    </vxe-table>

    <pagination
      v-show="total > 0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
  </div>
</template>

<script>
import {
  getOrderItems
} from "@/api/mes/sales/print";
export default {
  name: 'Property',
  props: {
    cellId: {
      type: String,
      default: ''
    },
  },
  data() {
    return {
      queryParams: {
        pageNum: 1,
        pageSize: 10,
      },
      tableData: [],
      total: 0,
    }
  },
  watch: {
    cellId: {
      handler( val) {
        if (val && val !== 'add') {
          this.getList();
        } else {
          this.tableData = [];
        }
      },
    }
  },
  methods: {
    getList() {
      getOrderItems(this.cellId).then(response => {
        if(response.code === 200) {
          this.tableData = response.data?.volist;
          this.total = response.total;
        }
      });
    },
  }
}
</script>

<style lang="scss" scoped>
.baseInfo{
  &-header{
    margin-bottom: 10px;
  }
}
</style>